//管理员前台service
export default {
    //登录
    login: ( admin) =>
        new Promise(resolve => {
            $.ajax({
                url: "/admins/login",
                type: "GET",
                data:  admin,
                success: data => resolve(data)
            });
        }),
    //注册
    reg: (admin) =>
        new Promise(resolve => {
            $.ajax({
                url: "/admins/reg",
                type: "POST",
                data: admin,
                success: data => resolve(data)
            });
        }),
    //验证注册名
    isUse: (adminName ) =>
        new Promise(resolve => {
            $.ajax({
                url: "admins/isUse",
                type: "POST",
                data: adminName ,
                success: data => resolve(data)
            });
        })
}